package com.example.helloworld;

import android.app.TabActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.TabHost;

public class DragTab extends TabActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.activity_drag_tab);
		
		TabHost tabHost = getTabHost();

		tabHost.addTab(
				tabHost.newTabSpec("tab01").setIndicator("01").setContent(R.id.tab1)
		);
		
		tabHost.addTab(
				tabHost.newTabSpec("tab02").setIndicator("02").setContent(R.id.tab2)
		);

		tabHost.addTab(
				tabHost.newTabSpec("tab03").setIndicator("03").setContent(R.id.tab3)
		);
		
		tabHost.setCurrentTab(0);// start tab

		tabHost.getTabWidget().getChildAt(0).setOnTouchListener(new OnTouchListener() {

			@Override
			public boolean onTouch(View arg0, MotionEvent arg1) {
				Log.e("onTouch", 
						String.format("%d", arg1.getAction())
				);
				
				return false;
			}
			
		});
	}

}
